class Alg<T extends Comparable<T>> {
    public T findMax(T[] array) {
        T max = array[0];//假设最大值在0下标
        for (int i = 0; i < array.length; i++) {
            if(max.compareTo(array[i]) > 0) {
                max = array[i];
            }
        }
        return max;
    }
}

public class MyTest {
    public static void main(String[] args) {
        Alg<Integer> alg = new Alg<Integer>();
        Integer[] array = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
        Integer ret = alg.findMax(array);
        System.out.println(ret);
    }
}
